package org.example.copy.DeepCopy;

import lombok.Data;

@Data
class Address implements Cloneable {
    private String street;
    private String city;
    public Address(String street, String city) {
        this.street = street;
        this.city = city;
    }
    // 实现克隆方法以进行深拷贝
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return new Address(this.street, this.city);
    }
}